<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateHostTaskTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('act_host_task', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('user_id')->default(0)->comment('主播ID');
            $table->string('task_type', 20)->default('')->comment('任务类型');
            $table->unsignedTinyInteger('reward_coin')->default(0)->comment('奖励金币数');
            $table->unsignedInteger('status')->default(0)->comment('任务状态');
            $table->timestamps();
            $table->index(['user_id', 'task_type'], 'user_task');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('host_task');
    }
}
